package com.ygqh.baby.service;

import java.util.List;

import com.ygqh.baby.ao.CommentType;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.model.YgMessageModel;
import com.ygqh.baby.po.YgMessage;

public interface YgMessageService {

	List<YgMessage> find();

	int findCount();

	YgMessage findById(Long id);

	int deleteSoft(Long[] ids, Long userId);

	int deleteSoft(Long id, Long userId);

	int save(YgMessage ygMessage);

	int update(YgMessage ygMessage);

	int saveOrUpdate(YgMessage ygMessage);

	ResultSet<YgMessage> search(QueryInfo queryInfo, String q);

	/**
	 * 获取当前用户消息列表
	 * 
	 * @param userId
	 * @param isRead
	 * @param commentType
	 * @return
	 */
	List<YgMessageModel> findUserMessageList(QueryInfo queryInfo, Long userId, Boolean isRead, CommentType commentType);

	/**
	 * 获取未读消息数量
	 * 
	 * @param id
	 * @return
	 */
	int findUnReadCount(Long id);

	/**
	 * 将该条消息设置为已读
	 * 
	 * @param messageId
	 * @param id
	 * @return
	 */
	int readMessage(Long messageId, Long id);

	/**
	 * 根据关联id获取消息列表
	 * 
	 * @param releationId
	 * @return
	 */
	List<YgMessage> findByReleationId(Long releationId);

}
